Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glow image rendering support; move image/svg code to iced_graphics #1485

Merged
merged 8 commits into from
Nov 5, 2022

Conversation

ids1024
Copy link
Contributor

@ids1024 ids1024 commented Oct 25, 2022

Fixes #674 and closes #1489.

This works, but duplicates code from iced_wgpu that should ideally be shared, and the cache never evicts.

The next step here is to work on an API design to move some of the image loading and caching logic from the backend to iced_graphics (or elsewhere?).

ids1024 added a commit to ids1024/iced that referenced this pull request Oct 26, 2022
This shows `iced_glow` outperforming `iced_wgpu`. Probably not accurate,
some something may be wrong in the rendering and timing here? It should
also test with more primitivies.

Tests pass when combined with iced-rs#1485
and iced-rs#1491.
ids1024 added a commit to ids1024/iced that referenced this pull request Oct 26, 2022
This shows `iced_glow` outperforming `iced_wgpu`. Probably not accurate,
something may be wrong in the rendering and timing here? It should also
test with more primitivies.

Tests pass when combined with iced-rs#1485
and iced-rs#1491.
@ids1024 ids1024 changed the title WIP glow image rendering support Glow image rendering support; move image/svg code to iced_graphics Nov 4, 2022
@ids1024 ids1024 force-pushed the glow-image branch 2 times, most recently from 9d0ed07 to 7ff4694 Compare November 4, 2022 01:55
@ids1024 ids1024 marked this pull request as ready for review November 4, 2022 02:11
@hecrj hecrj added this to the 0.5.0 milestone Nov 5, 2022
ids1024 and others added 4 commits November 5, 2022 03:19
The `TextureStore` trait is implemented by the atlas, and can also be
implemented in the glow renderer or in a software renderer.

The API here may be improved in the future, but API stability is
presumably not a huge issue since these types will only be used by
renderer backends.
iced-rs#674

Uses image/svg support in `iced_graphics`. The is not currently using an
atlas, and uses one texture/draw per image. This should be good enough
for now; supporting images with glow is better than not supporting them,
and if something else performs better, that improvement can be made
without any change to the public API.
- Use `Size<u32>` were applicable.
- Rename `TextureStore` to `image::Storage`.
- Rename `TextureStoreEntry` to `image::storage::Entry`.
- Wire up `viewport_dimensions` to `iced_glow` for `Svg`.
Copy link
Member

@hecrj hecrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been a long-awaited feature! Thanks 🥳

We are not leveraging a texture atlas in iced_glow, but this gets us one step closer!

I have made some changes here and there; check the latest commits! In any case, I think this is ready to go 🚢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

glow backend does not support Image
2 participants